package sanyuesan;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class SortString {
    public static void main(String[] args) {
        List<String>list=new ArrayList<>();
        list.add("www");
        list.add("qqq");
        list.add("eee");
        list.add("rrr");
        list.add("aaa");
        System.out.println("list原始数据:"+list);
        Collections.sort(list);
        System.out.println("list原始数据:"+list);









        /*
        List<String>list=new ArrayList<>();
        list.add("一号");
        list.add("二号");
        list.add("三号");
        list.add("四号");
        System.out.println("原始数据:"+list);

        Collections.sort(list,((o1, o2) -> -o1.length()-o2.length()));
        System.out.println("list排序后数据:"+list);

         */
    }
}
